import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpDistributeTx {
  id!: number;
  disId!: number;
  money!: string;
  txsjMoney!: string;
  txName?: string;
  txZhanghao?: string;
  time1?: string;
  time2?: string;
  state: boolean = true;
  txType!: number;
  uniacid!: number;
  deviceType!: number;
}

export const ImsYzdKpDistributeTxSchema = new EntitySchema({
  class: ImsYzdKpDistributeTx,
  properties: {
    id: { primary: true, type: 'number' },
    disId: { type: 'number', index: 'dis_id' },
    money: { type: 'string', columnType: 'numeric(10,2)' },
    txsjMoney: { type: 'string', columnType: 'numeric(10,2)' },
    txName: { type: 'string', length: 255, nullable: true },
    txZhanghao: { type: 'string', length: 255, nullable: true },
    time1: { type: 'string', length: 255, nullable: true },
    time2: { type: 'string', length: 255, nullable: true },
    state: { type: 'boolean', default: true, index: 'state' },
    txType: { type: 'number', index: 'tx_type' },
    uniacid: { type: 'number', index: 'uniacid' },
    deviceType: { type: 'number', fieldName: 'deviceType', index: 'deviceType' },
  },
});
